<?php

defined('__EAPI_BASE') or define('__EAPI_BASE', dirname(__FILE__));

class EAPICharSkillTraining extends EAPIxml{
	
	protected $inTraining;
	
	public function __Construct($apiCore,EAPIUser $uObj){
		try{

			parent::__Construct($apiCore);
			$this->inTraining = new SimpleXMLElement($this->getXML('/char/SkillInTraining.xml.aspx',$uObj));

		}catch (EAPIException $e){
			print $e;
			die();
		}catch (Exception $e){
			print "<pre>".__CLASS__."[{$e->getCode()}]: {$e->getMessage()}\n</pre>";
			die();
		}
		
	}
	public function __Destruct(){}
	
	public function getSkillInTraining(){
		
		if((string)$this->inTraining->result->{'skillInTraining'} == '0'){
			return "No Skill Training.";
		}
		$skill['currentTQTime']			= (string)$this->inTraining->result->{'currentTQTime'};
		$skill['trainingEndTime']		= (string)$this->inTraining->result->{'trainingEndTime'};
		$skill['trainingStartTime'] 	= (string)$this->inTraining->result->{'trainingStartTime'};
		$skill['trainingTypeID'] 		= (string)$this->inTraining->result->{'trainingTypeID'};
		$skill['trainingStartSP'] 		= (string)$this->inTraining->result->{'trainingStartSP'};
		$skill['trainingDestinationSP'] = (string)$this->inTraining->result->{'trainingDestinationSP'};
		$skill['trainingToLevel'] 		= (string)$this->inTraining->result->{'trainingToLevel'};
		$skill['skillInTraining'] 		= (string)$this->inTraining->result->{'skillInTraining'};
		
		return $skill;
	}
	
};